package com.guangyunl.a_private;
// 封装的使用
public class Test02 {
    public static void main(String[] args) {
        int[] arr2 = {1, 2, 3, 4};
//        Operator '+' cannot be applied to 'java.lang.String', 'void'
//        System.out.print("arr2 = " + method(arr2));
        System.out.print("arr2 = ");
        method(arr2);
    }
    public static void method(int[] arr){
        System.out.print("[");
        for (int i = 0; i < arr.length; i++) {
            if(i == arr.length-1){
                System.out.print(arr[i] + "]");
            }else {
                System.out.print(arr[i] + ", ");
            }
        }
    }
}
/*
arr2 = [1, 2, 3, 4]
 */